package com.gujiayue.module.sys.pojo;

import java.io.Serializable;

import org.springframework.security.core.GrantedAuthority;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Tolerate;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SysRoleDo implements GrantedAuthority, Serializable {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "主键")
	private int id;
	
	@ApiModelProperty(value = "角色主键")
	private String roleId;
	
	@ApiModelProperty(value = "唯一角色编码")
	private String code;

	@ApiModelProperty(value = "名称")
	private String name;
	
	public String getAuthority() {
		return code;
	}
	
	@Tolerate
	public SysRoleDo(String code) {
		this.code=code;
	}
}
